home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / __MANDEL / MANDELBR / CMANDELI.C1 < prev    next >
Text File  |  1992-03-26  |  2KB  |  56 lines

  1. /* CMandelIntervalDialog.c */
  2.  
  3. #include "CMandelApp.h"
  4. #include <Commands.h>
  5. #include <CIntegerText.h>
  6. #include "CMandelIntervalDialog.h"
  7. #include "CMandelDoc.h"
  8. #include <CWindow.h>
  9.  
  10. void CMandelIntervalDialog::IMandelIntervalDialog
  11.     (short DLOGid, CMandelDoc *aMandelDoc, CDirectorOwner *aSupervisor)
  12. {
  13.     CIntegerText *aEditItem;
  14.     
  15.     IDLOGDirector(DLOGid, aSupervisor);
  16.     FailNIL(aMandelDoc);
  17.     
  18.     itsMandelDoc = aMandelDoc;
  19.     
  20.     aEditItem = (CIntegerText *)itsWindow->FindViewByID(kFAwakeTicksEdit);
  21.     aEditItem->SetIntValue(itsMandelDoc->itsFAwakeTicks);
  22.     aEditItem = (CIntegerText *)itsWindow->FindViewByID(kFSleepTicksEdit);
  23.     aEditItem->SetIntValue(itsMandelDoc->itsFSleepTicks);
  24.     aEditItem = (CIntegerText *)itsWindow->FindViewByID(kBAwakeTicksEdit);
  25.     aEditItem->SetIntValue(itsMandelDoc->itsBAwakeTicks);
  26.     aEditItem = (CIntegerText *)itsWindow->FindViewByID(kBSleepTicksEdit);
  27.     aEditItem->SetIntValue(itsMandelDoc->itsBSleepTicks);
  28. }
  29.  
  30. void CMandelIntervalDialog::DoCommand( long aCmd)
  31. {
  32.     CIntegerText *aEditItem;
  33.  
  34.     switch (aCmd)
  35.     {
  36.         case cmdOK:
  37.             if (Validate())
  38.             {
  39.                 aEditItem = (CIntegerText *)itsWindow->FindViewByID(kFAwakeTicksEdit);
  40.                 itsMandelDoc->itsFAwakeTicks = CMandelDoc::cFAwakeTicks = aEditItem->GetIntValue();
  41.                 aEditItem = (CIntegerText *)itsWindow->FindViewByID(kFSleepTicksEdit);
  42.                 itsMandelDoc->itsFSleepTicks = CMandelDoc::cFSleepTicks = aEditItem->GetIntValue();
  43.                 aEditItem = (CIntegerText *)itsWindow->FindViewByID(kBAwakeTicksEdit);
  44.                 itsMandelDoc->itsBAwakeTicks = CMandelDoc::cBAwakeTicks = aEditItem->GetIntValue();
  45.                 aEditItem = (CIntegerText *)itsWindow->FindViewByID(kBSleepTicksEdit);
  46.                 itsMandelDoc->itsBSleepTicks = CMandelDoc::cBSleepTicks = aEditItem->GetIntValue();
  47.             }
  48.             else
  49.                 break;
  50.             
  51.         default:
  52.             inherited::DoCommand( aCmd);
  53.             break;
  54.     }
  55.     
  56. }